#include <iostream>

using namespace std;

/*
	final修饰类:该类不能被继承
	final修饰虚函数:该函数不能被重写

	override明确地表示一个函数是对基类中一个虚函数的重写

*/
//class Person final
class Person
{
private:
	int age;
public:
	void virtual print() final
	{
		cout << age << endl;
	}

	void virtual print_1()
	{
		cout << age << endl;
	}
};

class Teacher : Person
{
	//重写基类的函数,覆盖
	void  print_1() override
	{

	}
};


void main()
{
	system("pause");
}
